function mxEllipse(bounds, fill, stroke, strokewidth)
{
	this.bounds = bounds;
	this.fill = fill;
	this.stroke = stroke;
	this.strokewidth = strokewidth || 1;
};
mxEllipse.prototype = new mxShape();
mxEllipse.prototype.constructor = mxEllipse;
mxEllipse.prototype.mixedModeHtml = false;
mxEllipse.prototype.preferModeHtml = false;
mxEllipse.prototype.createVml = function()
{
	var node = document.createElement('v:arc');
	node.setAttribute('startangle', '0');
	node.setAttribute('endangle', '360');
	this.configureVmlShape(node);
	return node;
};
mxEllipse.prototype.createSvg = function()
{
	return this.createSvgGroup('ellipse');
};
mxEllipse.prototype.redrawSvg = function()
{
	this.updateSvgNode(this.innerNode);
	this.updateSvgNode(this.shadowNode);
};
mxEllipse.prototype.updateSvgNode = function(node)
{
	if (node != null)
	{
		var strokeWidth = Math.max(1, this.strokewidth * this.scale);
		node.setAttribute('stroke-width', strokeWidth);
		node.setAttribute('cx', this.bounds.x + this.bounds.width / 2);
		node.setAttribute('cy', this.bounds.y + this.bounds.height / 2);
		node.setAttribute('rx', this.bounds.width / 2);
		node.setAttribute('ry', this.bounds.height / 2);
	}
};

function mxDoubleEllipse(bounds, fill, stroke, strokewidth)
{
	this.bounds = bounds;
	this.fill = fill;
	this.stroke = stroke;
	this.strokewidth = strokewidth || 1;
};
mxDoubleEllipse.prototype = new mxShape();
mxDoubleEllipse.prototype.constructor = mxDoubleEllipse;
mxDoubleEllipse.prototype.mixedModeHtml = false;
mxDoubleEllipse.prototype.preferModeHtml = false;
mxDoubleEllipse.prototype.createVml = function()
{
	var node = document.createElement('v:group');
	this.background = document.createElement('v:arc');
	this.background.setAttribute('startangle', '0');
	this.background.setAttribute('endangle', '360');
	this.configureVmlShape(this.background);
	node.appendChild(this.background);
	this.label = this.background;
	this.isShadow = false;
	this.fill = null;
	this.foreground = document.createElement('v:oval');
	this.configureVmlShape(this.foreground);
	node.appendChild(this.foreground);
	this.stroke = null;
	this.configureVmlShape(node);
	return node;
};
mxDoubleEllipse.prototype.redrawVml = function()
{
	var x = Math.floor(this.bounds.x);
	var y = Math.floor(this.bounds.y);
	var w = Math.floor(this.bounds.width);
	var h = Math.floor(this.bounds.height);
	var s = this.strokewidth * this.scale;
	this.updateVmlShape(this.node);
	this.node.setAttribute('coordsize', w + ',' + h);
	this.updateVmlShape(this.background);
	this.background.setAttribute('strokeweight', s);
	this.background.style.top = '0px';
	this.background.style.left = '0px';
	this.updateVmlShape(this.foreground);
	this.foreground.setAttribute('strokeweight', s);
	var inset = 3 + s;
	this.foreground.style.top = inset + 'px';
	this.foreground.style.left = inset + 'px';
	this.foreground.style.width = Math.max(0, w - 2 * inset) + 'px';
	this.foreground.style.height = Math.max(0, h - 2 * inset) + 'px';
};
mxDoubleEllipse.prototype.createSvg = function()
{
	var g = this.createSvgGroup('ellipse');
	this.foreground = document.createElementNS(mxConstants.NS_SVG, 'ellipse');

	if (this.stroke != null)
	{
		this.foreground.setAttribute('stroke', this.stroke);
	}
	else
	{
		this.foreground.setAttribute('stroke', 'none');
	}
	this.foreground.setAttribute('fill', 'none');
	g.appendChild(this.foreground);
	return g;
};
mxDoubleEllipse.prototype.redrawSvg = function()
{
	var s = this.strokewidth * this.scale;
	this.updateSvgNode(this.innerNode);
	this.updateSvgNode(this.shadowNode);
	this.updateSvgNode(this.foreground, 3 * this.scale + s);
};
mxDoubleEllipse.prototype.updateSvgNode = function(node, inset)
{
	inset = (inset != null) ? inset : 0;

	if (node != null)
	{
		var strokeWidth = Math.max(1, this.strokewidth * this.scale);
		node.setAttribute('stroke-width', strokeWidth);
		node.setAttribute('cx', this.bounds.x + this.bounds.width / 2);
		node.setAttribute('cy', this.bounds.y + this.bounds.height / 2);
		node.setAttribute('rx', this.bounds.width / 2 - inset);
		node.setAttribute('ry', this.bounds.height / 2 - inset);
	}
};